﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manage/MasterPage.master" AutoEventWireup="true"
    CodeFile="DengXin_Book_Mode.aspx.cs" Inherits="Manage_DengXin_Book_Mode" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        #dengxin_mode_table
        {
            width: 99%;
            border-collapse: collapse;
            empty-cells: show;
            margin-left: 8px;
            margin-top: 10px;
            margin-bottom: 20px;
        }
        #dengxin_mode_table tr
        {
            height: 35px;
            background: #f6f6f6;
        }
        #dengxin_mode_table tr td
        {
            border: #d8d8d8 1px solid;
            vertical-align: middle;
        }
        #dengxin_mode_table tr .td1
        {
            width: 110px;
            text-align: right;
            padding-right: 15px;
        }
        #dengxin_mode_table tr .td2
        {
            padding: 15px;
        }
        #dengxin_mode_table tr .td2 .tinput
        {
            height: 25px;
            width: 300px;
            font-size: 18px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:HiddenField runat="server" ID="BookId" />
    <table id="dengxin_mode_table">
        <tr style="height: 25px; background: url('images/tt_x.gif') repeat-x;">
            <td colspan="2" style="padding-left: 8px;">
                新建灯心文集
            </td>
        </tr>
        <tr>
            <td class="td1">
                期数名称:
            </td>
            <td class="td2">
                <asp:TextBox ID="PeriodsName" runat="server" CssClass="tinput"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="PeriodsName"
                    runat="server" Display="Dynamic" ErrorMessage="期数名称不能为空,"></asp:RequiredFieldValidator>
                格式建议(灯心文集第**期)
            </td>
        </tr>
        <tr>
            <td class="td1">
                期数索引:
            </td>
            <td class="td2">
                <asp:TextBox ID="DIndex" runat="server" CssClass="tinput"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="DIndex"
                    runat="server" Display="Dynamic" ErrorMessage="期数索引不能为空,"></asp:RequiredFieldValidator>
                建议和用期数的数字
            </td>
        </tr>
        <tr>
            <td class="td1">
                出版年份:
            </td>
            <td class="td2">
                <asp:DropDownList ID="PublishYear" runat="server">
                </asp:DropDownList>
                <asp:CompareValidator ID="comparevalidator3" runat="server" Display="Dynamic" ControlToValidate="PublishYear"
                    Type="String" ValueToCompare="出版年份" Operator="NotEqual" ErrorMessage="请选择出版年份"></asp:CompareValidator>
            </td>
        </tr>
        <tr>
            <td class="td1">
                灯心封面:
            </td>
            <td class="td2">
                <asp:HiddenField runat="server" ID="picguid" />
                <asp:HiddenField runat="server" ID="filename" />
                <asp:Image ID="pic" runat="server" Width="320px"  /><br />
                <asp:FileUpload ID="PicFileUpload" runat="server" />
                <asp:Button ID="UpLoadPic" runat="server" Text="上传图片" OnClick="UpLoadPic_Click" />&nbsp;&nbsp;(请用ps等软件把图片宽度设置为185px)
            </td>
        </tr>
        <tr>
            <td class="td1">
                <asp:Label ID="Chapter_lb" runat="server" Text="章节管理" Visible="false"></asp:Label>
            </td>
            <td class="td2">
                <asp:UpdatePanel ID="UpdatePanel2" runat="server" Visible="false">
                    <ContentTemplate>
                        <asp:GridView ID="Chapter_gv" runat="server" Width="100%" CellPadding="3" EnableModelValidation="True"
                            ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" OnRowCancelingEdit="Chapter_gv_RowCancelingEdit"
                            OnRowEditing="Chapter_gv_RowEditing" OnRowUpdating="Chapter_gv_RowUpdating" OnRowDeleting="Chapter_gv_RowDeleting"
                            DataKeyNames="CatalogueId">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:TemplateField ItemStyle-Width="30">
                                    <ItemTemplate>
                                        <asp:Label ID="id" runat="server" Text='<%#Eval("CatalogueId")%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="章节名称">
                                    <ItemTemplate>
                                        <%#Eval("ChapterName")%>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="ChapterName" runat="server" Text=' <%#Eval("ChapterName")%>'></asp:TextBox>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" HeaderText="操作" ItemStyle-Width="100">
                                </asp:CommandField>
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        </asp:GridView>
                        <br />
                        章节名称：
                        <asp:TextBox ID="ChapterName_tb" runat="server"></asp:TextBox>
                        <asp:Button ID="add_chapter_btn" runat="server" Text="添加章节" 
                            onclick="add_chapter_btn_Click" />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td class="td1">
            </td>
            <td class="td2">
                <asp:Button ID="submit" runat="server" Text="添加并创建章节" Style="float: right;" />
            </td>
        </tr>
    </table>
</asp:Content>
